package com.blank.shop.security.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.time.Duration;

/**
 * <br/>Date 2021/9/9
 * <br/>Time 23:13:59
 *
 * @author _blank
 */
@Data
@ConfigurationProperties(prefix = "blank.zou")
public class BlankShopProperties {

    @NestedConfigurationProperty
    private BrowserProperties browser;


    @Data
    public static class BrowserProperties {
        private String loginPage = "/default-sign-in.html";
        private LoginType loginType = LoginType.JSON;
        private Duration rememberMe = Duration.ofMinutes(1L);
    }

    public enum LoginType {
        /**
         * JSON
         */
        JSON,
        /**
         * REDIRECT
         */
        REDIRECT
    }

}
